package com.wondertek.mist.gallery;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.wondertek.mist.plugins.WebViewPlugin;
import com.wondertek.mist.utils.RUtil;




public class WebViewer extends Activity {

	private String webURL;
	private WebView webView;



	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(RUtil.layout(this,"activity_web_viewer"));

		Bundle bundle = getIntent().getExtras();

		webURL = bundle.getString(WebViewPlugin.MIST_WEBURL_EXTRA);
		String type = bundle.getString(WebViewPlugin.MIST_TYPE_EXTRA);
		String message = bundle.getString(WebViewPlugin.MIST_MESSAGE_EXTRA);
		String placeholder = bundle.getString(WebViewPlugin.MIST_PLACEHOLDER_EXTRA);

		//		Log.i("guolai", webURL+","+type+","+message+","+placeholder);

		WebView wv=(WebView) findViewById(RUtil.id(this,"webView1"));

		//		wv.setVisibility(WebView.VISIBLE);

		WebSettings ws = wv.getSettings();

		//ws.setUseWideViewPort(true);

		ws.setJavaScriptEnabled(true);

		wv.setWebViewClient(new WebViewClient(){
			@Override
			public boolean shouldOverrideUrlLoading(WebView view, String url) {

				view.loadUrl(url);   //在当前的webview中跳转到新的url

				return true;
			}
		});

		wv.loadUrl(webURL);


	}


}

